//模拟事件委托
var EventCenter = {

    RaiEvent : function() {
        var evt = new Object;
        evt.eventList = [];
        evt.addListener = function(func) {
            this.eventList.push(func);
        };
        evt.broadcast = function() {
            for(let i = 0; i < this.eventList.length; i++)
            {
                let func = this.eventList[i];
                func(...arguments);
            }
        };
        return evt;
      },

    GameStart: Object,
    GameFinish: Object,
    TurnStart: Object,
    TurnEnd: Object,
    LBCheck: Object,//Line boost
    LBDone: Object,
    VCCheck: Object,//Virus check
    VCDone: Object,
    NFCheck: Object,//404 not found
    NFDone: Object,
    FWCheck: Object,//Fire wall
    FWDone: Object,
    RVCheck: Object,//Random verification
    RVDone: Object,
    WDCheck: Object,//Worm diffusion
    WDDone: Object,
    ZDACheck: Object,//Zero day attack
    ZDADone: Object,
    SCCheck: Object,//Script confusion
    SCDone: Object,
    SBCheck: Object,//Sand Box
    SBDone: Object,
    SelectMove: Object,
    MoveDone: Object,
    ShotBullet: Object,
    RecvMap: Object,

    init : function()
    {
        this.GameStart = this.RaiEvent();
        this.GameFinish = this.RaiEvent();
        this.TurnStart = this.RaiEvent();
        this.TurnEnd = this.RaiEvent();
        this.LBCheck = this.RaiEvent();//Line boost
        this.LBDone = this.RaiEvent();
        this.VCCheck = this.RaiEvent();//Virus check
        this.VCDone = this.RaiEvent();
        this.NFCheck = this.RaiEvent();//404 not found
        this.NFDone = this.RaiEvent();
        this.FWCheck = this.RaiEvent();//Fire wall
        this.FWDone = this.RaiEvent();
        this.RVCheck = this.RaiEvent();//Random verification
        this.RVDone = this.RaiEvent();
        this.WDCheck = this.RaiEvent();//Worm diffusion
        this.WDDone = this.RaiEvent();
        this.ZDACheck = this.RaiEvent();//Zero day attack
        this.ZDADone = this.RaiEvent();
        this.SCCheck = this.RaiEvent();//Script confusion
        this.SCDone = this.RaiEvent();
        this.SBCheck = this.RaiEvent();//Sand Box
        this.SBDone = this.RaiEvent();
        this.SelectMove = this.RaiEvent();
        this.MoveDone = this.RaiEvent();
        this.ShotBullet = this.RaiEvent();
        this.RecvMap = this.RaiEvent();
    }

};

module.exports = EventCenter;